package cn.cloud.butler.uploadapi.repository;

import cn.cloud.butler.uploadapi.domain.CompMacSNEntity;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;

import java.util.List;

public interface CompMacSNRepository extends JpaRepository<CompMacSNEntity,Long> {

    @Query(value=" SELECT MacSN from CompMacSN WHERE CompID in (SELECT CompID from CompFact WHERE MacFacID = ?1)" ,nativeQuery = true)
    List<String> selMacSNByMacFac(Integer macFacId);

    @Query(value=" select distinct MacSN from CompMacSN where CompID=?1" ,nativeQuery = true)
    List<String> selMacSNByCompid(Integer compId);
}
